home *** CD-ROM | disk | FTP | other *** search
/ IRIX 6.5 Applications 1999 November / SGI IRIX 6.5 Applications 1999 November.iso / dev / insight_dev.idb / usr / share / Insight / bin / sgibook_qa.z / sgibook_qa
Encoding:
Text File  |  1998-10-28  |  1.6 KB  |  48 lines

  1. #!/usr/sbin/perl
  2.  
  3. print "\n";
  4.  
  5. @MAKEFILE_VARS=(TITLE,FULL_TITLE,VERSION,BOOKSHELF,BOOK_ICON,BOOK_LANG,DTD,SORT_ORDER,HIDDEN);
  6. open(MAKEFILE,"Makefile");
  7. foreach $MAKE_VAR (@MAKEFILE_VARS) {
  8.   while ($MAKE_LINE = <MAKEFILE>) {
  9.     if (grep(/^\s*($MAKE_VAR)/,$MAKE_LINE)) {
  10.       print "$MAKE_LINE";
  11.       if ($MAKE_VAR eq "VERSION") {
  12.         if ( ${MAKE_LINE} !~ /^\s*VERSION\s*=\s*\d{3}-\d{4}-\d{3}(,\s*\d+\/\d+\s*)?$/ ) { 
  13.           print "  WARNING: VERSION string does not use standard partnumbering format:\n\n  xxx-xxxx-xxx[, xx/xx]\n\n";
  14.         }
  15.         else {
  16.           ($PARTNUM = $MAKE_LINE) =~ s/^\s*VERSION\s*=\s*(\d{3}-\d{4}-\d{3}([DEFRJP]{2})?)(,\s*\d+\/\d+\s*)?\n/$1/;
  17.           $CWD_PATH = `pwd`;
  18.           ($CWD = $CWD_PATH) =~ s/^.*\/([^\/]+)/$1/;
  19.           chop $CWD;
  20.           if ( $PARTNUM ne $CWD ) {
  21.             print "  WARNING: VERSION string $PARTNUM does not match dir $CWD\n";
  22.           }
  23.         }
  24.       }
  25.       last;
  26.     }
  27.   }
  28.   if (eof) {
  29.     print "$MAKE_VAR is undefined";
  30.     if ($MAKE_VAR eq "BOOKSHELF") {
  31.       print "; default is \"SGI_EndUser\"\n"; }
  32.     elsif ($MAKE_VAR eq "BOOK_ICON") {
  33.       print "; default is \"generic\"\n"; }
  34.     elsif ($MAKE_VAR eq "BOOK_LANG") {
  35.       print "; default is \"C\"\n"; }
  36.     elsif ($MAKE_VAR eq "DTD") {
  37.       print "; default is \"SGIDOC\"\n"; }
  38.     elsif ($MAKE_VAR eq "SORT_ORDER") {
  39.       print "; default is \"\"\n  Note: this is appropriate except for a few special cases\n"; }
  40.     elsif ($MAKE_VAR eq "HIDDEN") {
  41.       print "; default is \"FALSE\"\n"; }
  42.     else {
  43.       print "\n"; }
  44.   }
  45.   seek(MAKEFILE,0,0);
  46. }
  47. print "\n";
  48.